#!/usr/bin/python

##Acknowledgements:
##    Infinite Recursion - IR-GTS/IR-GTS-BW
##    LordLandon - sendpkm.py
##    Project Pokemon - http://projectpokemon.org/wiki/GTS_protocol
##    YoshiOG1 - inspiration to make this
from resources import getirgtscode
from resources.src import gtsvar
from customresources.pokehaxlib import initServ
from resources.src.getpkm import getpkm
from customresources.sendpkmwrapper import sendpkm
from customresources.gui.rootWindow import rootWindow
from platform import system
from sys import argv, exit
from time import sleep
import os
import thread
s = system()
if s == 'Darwin' or s == 'Linux':
    print 'This program will not auto update while running on unix\/linux\/mac\n'
    if os.getuid() != 0:
        
        print 'Program must be run as superuser. Enter your password below',
        print 'if prompted.'
        os.system('sudo ' + argv[0] + ' root')
        exit(0)
else:
    getirgtscode.updateResources()
    

#print gtsvar.version
root = rootWindow(initServ,sendpkm,getpkm,gtsvar)
root.mainloop()
exit(0)

